package com.apes.scm.settle.payment.repository;

import com.apes.framework.jpa.repository.CustomRepository;
import com.apes.scm.settle.payment.model.PaymentExecuteRecord;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * 付款执行记录
 *
 * @author wuq
 * @create 2018-11-02 15:57
 */
public interface PaymentExecuteRecordRepository extends CustomRepository<PaymentExecuteRecord,String> {

    @Query("select a from PaymentExecuteRecord a " +
            "where a.company.id = :companyId and a.partner.id = :partnerId and a.state = 'create' ")
    List<PaymentExecuteRecord> findAllForPayment(@Param("companyId") String companyId, @Param("partnerId") String partnerId);

}
